<?php

use Hyperf\Database\Schema\Schema;
use Hyperf\Database\Schema\Blueprint;
use Hyperf\Database\Migrations\Migration;

class CreateTableContentStatic extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('content_static', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->char('path', 40)->nullable(false)->comment('路径,[2]/[30][7]');
            $table->string('extension', 10)->default('')->comment('扩展名');
            $table->string('title', 255)->default('')->comment('文字描述');
            $table->timestamps();
            $table->unique('path', 'uk_path');
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('content_static');
    }
}
